import 'package:flutter/material.dart';
import 'package:kuaitong/units/screen_units.dart';

class List extends StatefulWidget {
  @override
  _ListState createState() => _ListState();
}

class _ListState extends State<List> {
  @override
  Widget build(BuildContext context) {
    final screen = Screen(context);
    return Container(
      child: Column(
        children: [
          Container(
            width: screen.width,
            decoration: BoxDecoration(
                color: Colors.white,
                border: Border(
                    bottom: BorderSide(color: Colors.black12, width: 1))),
            padding: EdgeInsets.all(10),
            child: Text(
              "咨询",
              style: TextStyle(
                  color: Color(0xffee6728),
                  fontSize: screen.salc(30),
                  fontWeight: FontWeight.w200),
            ),
          ),
          Container(
            child: Column(
              children: [1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7].map((e) {
                if (e % 3 == 0) {
                  return Container(
                    width: screen.width,
                    decoration: BoxDecoration(
                        border: Border(
                            bottom:
                                BorderSide(color: Colors.black12, width: 1))),
                    padding: EdgeInsets.all(10),
                    child: Column(
                      children: [
                        Container(
                          width: screen.width,
                          child: Column(
                            children: [
                              Container(
                                width: screen.width,
                                height: 60,
                                child: Text(
                                  '应苹果要求把部分生产线移出中国应苹果要求把部分生产线移出中国应苹果要求把部分生产线移出中国？富士康：不评论传言',
                                  style: TextStyle(fontSize: 15, height: 1.5),
                                  maxLines: 2,
                                  textAlign: TextAlign.left,
                                  overflow: TextOverflow.ellipsis,
                                ),
                              ),
                              Row(
                                children: [
                                  Container(
                                    width: ((screen.width - 60) / 3),
                                    margin:
                                        EdgeInsets.only(right: screen.salc(20)),
                                    child: Image.network(
                                      'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1191837052,173126185&fm=26&gp=0.jpg',
                                      width: ((screen.width - 60) / 3),
                                      height: 80,
                                    ),
                                  ),
                                  Container(
                                    width: ((screen.width - 60) / 3),
                                    margin:
                                        EdgeInsets.only(right: screen.salc(20)),
                                    child: Image.network(
                                      'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1191837052,173126185&fm=26&gp=0.jpg',
                                      width: ((screen.width - 60) / 3),
                                      height: 80,
                                    ),
                                  ),
                                  Container(
                                    width: ((screen.width - 60) / 3),
                                    child: Image.network(
                                      'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1191837052,173126185&fm=26&gp=0.jpg',
                                      width: ((screen.width - 60) / 3),
                                      height: 80,
                                    ),
                                  ),
                                ],
                              )
                            ],
                          ),
                        ),
                      ],
                    ),
                  );
                } else if (e % 3 == 2) {
                  return Container(
                    width: screen.width,
                    decoration: BoxDecoration(
                        border: Border(
                            bottom:
                                BorderSide(color: Colors.black12, width: 1))),
                    padding: EdgeInsets.all(10),
                    child: Row(
                      children: [
                        Container(
                          width: (screen.width - 160),
                          child: Column(
                            children: [
                              Container(
                                width: (screen.width - 160),
                                padding:
                                    EdgeInsets.only(right: screen.salc(20)),
                                height: 60,
                                child: Text(
                                  '应苹果要求把部分生产线移出中国应苹果要求把部分生产线移出中国应苹果要求把部分生产线移出中国？富士康：不评论传言',
                                  style: TextStyle(fontSize: 15, height: 1.5),
                                  maxLines: 2,
                                  textAlign: TextAlign.left,
                                  overflow: TextOverflow.ellipsis,
                                ),
                              ),
                              Container(
                                width: (screen.width - 160),
                                height: 20,
                                child: Text(
                                  '前言扫所',
                                  style: TextStyle(
                                      fontSize: 10, color: Color(0xffee6728)),
                                  maxLines: 2,
                                  textAlign: TextAlign.left,
                                  overflow: TextOverflow.ellipsis,
                                ),
                              )
                            ],
                          ),
                        ),
                        Container(
                          width: 140,
                          decoration: BoxDecoration(color: Colors.green),
                          child: Image.network(
                            'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1191837052,173126185&fm=26&gp=0.jpg',
                            width: 140,
                            height: 80,
                          ),
                        ),
                      ],
                    ),
                  );
                } else {
                  return Container(
                    width: screen.width,
                    decoration: BoxDecoration(
                        border: Border(
                            bottom:
                                BorderSide(color: Colors.black12, width: 1))),
                    padding: EdgeInsets.all(10),
                    child: Row(
                      children: [
                        Container(
                          width: (screen.width - 160),
                          child: Column(
                            children: [
                              Container(
                                width: (screen.width - 160),
                                padding:
                                    EdgeInsets.only(right: screen.salc(20)),
                                height: 60,
                                child: Text(
                                  '应苹果要求把部分生产线移出中国应苹果要求把部分生产线移出中国应苹果要求把部分生产线移出中国？富士康：不评论传言',
                                  style: TextStyle(fontSize: 15, height: 1.5),
                                  maxLines: 2,
                                  textAlign: TextAlign.left,
                                  overflow: TextOverflow.ellipsis,
                                ),
                              ),
                              Container(
                                width: (screen.width - 160),
                                height: 20,
                                child: Text(
                                  '前言扫所',
                                  style: TextStyle(
                                      fontSize: 10, color: Color(0xffee6728)),
                                  maxLines: 2,
                                  textAlign: TextAlign.left,
                                  overflow: TextOverflow.ellipsis,
                                ),
                              )
                            ],
                          ),
                        ),
                        Container(
                          width: 140,
                          decoration: BoxDecoration(color: Colors.green),
                          child: Image.network(
                            'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1191837052,173126185&fm=26&gp=0.jpg',
                            width: 140,
                            height: 80,
                          ),
                        ),
                      ],
                    ),
                  );
                }
              }).toList(),
            ),
          )
        ],
      ),
    );
  }
}
